<template>
  <div class='container'>
    <div class="pageTitle">荣誉墙</div>
    <el-divider />
    <div class="list">
      <div class="item" v-for="(item, index) in honorListData" key="index">
        <div class="left">
          <img :src="baseStr + item.userAttr" alt="">
        </div>
        <div class="right">
          <div class="rightItem"><span class="desc">昵称：</span><span class="detail">{{item.userName}}</span></div>
          <div class="rightItem"><span class="desc">称号：</span><span class="detail">{{item.userSalutation}}</span></div>
          <div class="rightItem"><span class="desc">获赞数：</span><span class="detail">{{item.userSart}}</span></div>
          <!-- <div class="rightItem"><span class="desc">注册时间：</span><br/><span class="detail">{{item.userSignDate}}</span></div> -->
          <div class="rightItem">
            <span class="desc">个性签名：</span>
            <br></br>
            <el-tooltip
              :content="item.userDesc"
              placement="bottom"
              effect="light"
            >
              <span class="detail descDetail">{{item.userDesc}}</span>
            </el-tooltip>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts" name="userHonor">
import * as api from '@/api/index'
import { onMounted, reactive } from 'vue'
import { postAction } from '@api/request'
// 列表相关url
let pageUrl = {
  list: api.admin.URL_USERLIST
}
let baseStr: string = import.meta.env.config_concat
let honorListData: any = reactive([])

onMounted(() => {
  getHonorList()
})

let getHonorList = () => {
  postAction(pageUrl.list, { userHonor: true }).then((res: BaseResponse<BaseListType>) => {
    if (res.header.code === 999) {
      honorListData.push(...res.body.data)
    }
  })
}
</script>

<style lang="less" scoped>
 .container {
  .pageTitle {
    text-align: left;
    font-size: 20px;
    font-weight: 700;
    font-family: "楷体";
    margin-top: 10px;
    padding-left: 18px;
  }
  .list{
    padding: 0px 24px;
    box-sizing: border-box;
    display: flex;
    justify-content: left;
    align-items: start;
    flex-wrap: wrap;
    .item{
      width: 340px;
      height: 160px;
      display: flex;
      justify-content: left;
      align-items: start;
      margin-left: 40px;
      margin-bottom: 24px;
      .left {
        width: 140px;
        height: 160px;
        margin-right: 8px;
        border-radius: 8px;
        overflow: hidden;
        img{
          height:100%;
        }
      }
      .right {
        flex: 1;
        font-size: 16px;
        font-weight: 700;
        font-family: "楷体";
        padding: 12px 4px;
        box-sizing: border-box;
        .rightItem{
          padding-bottom: 6px;
          .descDetail {
            display: -webkit-box;
            overflow: hidden;
            text-overflow: ellipsis;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
          }
        }
      }
    }
  }
 }
</style>
